<?php
namespace chat\controllers;

use common\models\Admin;

class IndexController extends BaseController
{
    public function actionIndex()
    {
        return json_encode(['msg_type'=>'text','data'=>'hello world']);
    }

    public function actionWelcome()
    {
        return json_encode(Admin::find()->asArray()->all());
    }

    public function actionLogin()
    {
        // 如果客服登录的话,就要标记在线,同时记录登录的id
        return json_encode(['msg_type'=>'text','data'=>'登录成功']);
    }
}